1. the loop body is only executed once.
count == 11
andincrement == 2
will work, as will many others.
2. the loop body is executed twice.
count == 0
andincrement == 7
will work, as will many others.
3. the loop body is not executed at all.
count == 100
andincrement == 1
will work, as will many others.
4. the loop goes on forever.
count == 0
andincrement == -1
will work, as will many others.
5. the loop body prints only "6" .
count == 6
andincrement == 15
will work, as will many others.
Each execution of a loop body is called an iteration. Sometimes the general concept of looping is also called iteration.
In a counting loop, each iteration changes an integer loop control variable by an integer amount. The amount of change can be positive or negative.
Say that during a run of a program,
the body of a loop was executed 5 times.
How many times was the conditional part of the while
statement
evaluated?